package pro.softzhang.algo.lc1700;

import java.util.Arrays;

public class LC1798_MaximumNumberOfConsecutiveValuesYouCanMake {
    public static void main(String[] args) {

    }

    static class Solution {
        public int getMaximumConsecutive(int[] coins) {
            Arrays.sort(coins);
            int max = 0;
            for (int coin : coins)
                if (max + 1 >= coin)
                    max += coin;
            return max + 1;
        }
    }
}
